<?php Yii::app()->clientScript->registerCoreScript('jquery');?>
<style>
    body.loading{
        background: url('./images/ajax-loader-bar.gif') 50% 50% no-repeat;
    }
</style>
<script>
    
    $(document).ready(function(){
        $('body').addClass('loading');
        $.ajax({
            url:'<?php echo $url; ?>',
            type:'get',
            timeOut:1000*60*60,
            complete:function(){
                $('body').removeClass('loading');
            },
            success:function(data){
                if(data!=null){
                    var json=$.parseJSON(data);
                    if(json.success==true){
                        $('body').empty();
                        if(json.msg.filename!=null){
                            var pdf=$('<object height="1250px" width="100%" height="100%" type="application/pdf" data="'+json.msg.filename+'">\
                                        <param value="'+json.msg.filename+'" name="src"/>\
                                        <param value="transparent" name="wmode"/>\
                                        </object>').appendTo('body');
                                                 
                        }else{
                            $('body').append(json.msg.html);
                        }
                    }
                }
                
                
            }
        })
    })
</script>
